<?php

namespace App\Http\Resources\Apps;

use Illuminate\Http\Resources\Json\JsonResource;

class UserCouponRecordResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id'        => $this['id'],
            'user_id'   => $this['user_id'],
            'admin_name'=> $this['admin']['name'],
            'amount'    => $this['amount'],
            'price'     => $this['price'],
            'desc'      => $this['desc'],
            'created_at'=> $this['created_at'],
        ];
    }
}
